namespace Excerise;

public class Library
{
    private List<Book> Books = new List<Book>();

    public void AddBook(Book book)
    {
        Books.Add(book);
        System.Console.WriteLine("添加图书成功");
    }

    public void RemoveBook(Book book)
    {
        Books.Remove(book);
        System.Console.WriteLine("移除图书成功");
    }

    public void DisplayBooks()
    {
        foreach (var item in Books)
        {
            System.Console.WriteLine($"图书信息: 图书编号:{item.BookId},图书名称:{item.BookName}");
        }
    }
}